how to write function in c